/*
 * Base.h
 *
 *  Created on: 29/05/2012
 *      Author: lucho0
 */

#ifndef BASE_H_
#define BASE_H_

#include "../WidgetMovimiento.h"
#include "../WidgetSonido.h"
#include "ProgressBar.h"
#include "Flagger.h"


#define BASE_DEFAULT_ENERGY 100
#define PLAYER_DEFAULT_LIVES 3
#define LIVES_POSX_FIX 25
#define LIVES_POSY_FIX 25
#define BASE_DEFAULT_DAMAGE 100
#define PROGRESS_BAR_POSX_FIX 27
#define PROGRESS_BAR_POSY_FIX 15
#define FLAGGER_POS_FIX 15


class Base: public WidgetMovimiento, WidgetSonido {
public:
	Base(std::string userName, int posX, int posY, int fontSize,
			std::string imageSurface, Widget* parent);
	virtual ~Base();
	int getLives();
	void reduceLives();
	void reduceEnergy(int value);
	int getEnergy();
	virtual void handleColision(WidgetMovimiento *with);
	virtual void showOn(SDL_Surface* surface);

	bool duenoesinstancialocal;
	std::string owner;

private:
	ProgressBar* progressBar;
	int lives;
	Flagger* flagger;
	int fontSize;
	std::string image;
	Label* userName;

	bool isDead();

};

#endif /* BASE_H_ */
